import mysql.connector

def connect_to_mysql():
    try:
        connection = mysql.connector.connect(
            host='your_host',
            user='your_user',
            password='your_password',
            database='your_database'
        )
        return connection
    except mysql.connector.Error as err:
        print(f"Error: {err}")
        return None